package com.ikcai.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ikcai.dao.UniversityMapper;
import com.ikcai.pojo.University;
import com.ikcai.service.UniversityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by zhaoli on 2017/8/15.
 */
@Service
public class IUniversityService implements UniversityService {
    @Autowired
    private UniversityMapper universityMapper ;

    public University getUniversityByPrimaryKey(Integer id) {
        return universityMapper.selectByPrimaryKey(id);
    }

    public List<University> getUniversityList(int page,int pagesize) {
        PageHelper.startPage(page,pagesize);
        List<University> list = universityMapper.queryByPage();
        PageInfo<University> pageInfo = new PageInfo<University>(list);
        return pageInfo.getList();
      // return new ArrayList<University>();
    }
}
